package com.jn.erp.web.api.student.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 学生表
 * </p>
 *
 * @author 541720500@qq.com
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("t_student")
@ApiModel(value = "Student对象", description = "学生表")
public class Student  {

    private static final long serialVersionUID = 1L;

    @Excel(name ="序号")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;


    @ApiModelProperty(value = "家长id")
    private Long userId;

    @ApiModelProperty(value = "家庭关系")
    private String familyRel;


    @ApiModelProperty(value = "阶段状态")
    private Integer stage;

    @ApiModelProperty(value = "性别")
     //    0 男 1 女
    private Integer gender;


    @ApiModelProperty(value = "学号")
    private String idcard;

    @ApiModelProperty(value = "转为历史学员原因")
    private String turnHistoryReason;

    @ApiModelProperty(value = "转为历史学员日期")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private LocalDate turnHistoryDate;

    @ApiModelProperty(value = "逻辑删除")
    private Integer deleted;

    @ApiModelProperty(value = "入学年份")
    private Integer grade;

    @ApiModelProperty(value = "入学日期")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(exist = false)
    private LocalDateTime createTime;

    private LocalDate joinDate;

    @ApiModelProperty(value = "当前积分")
    private Integer credit;

    @ApiModelProperty(value = "创建者所属机构")
    @TableField(fill = FieldFill.INSERT)
    private Long orgId;


    @ApiModelProperty(value = "编辑时间")
    private LocalDateTime editTime;


    @ApiModelProperty(value = "编辑者")
    private Long editor;

    /**
     * 续费预警配置id
     */
    private Integer  cofId;

    /**
     * 跟进id
     */
    @TableField(exist = false)
    private String recordId;

    /**
     * 学生所有的订单
     */
    @TableField(exist = false)
    private List<StudentCourse> studentCourseList;

//    --------------------------------
@Excel(name ="姓名")
    @ApiModelProperty(value = "姓名")
    private String name;

    @Excel(name ="电话")
    @TableField(exist = false)
    @ApiModelProperty(value = "电话")
    private String mobile;

    @Excel(name ="学生来源")
    @ApiModelProperty(value = "加入方式")
    private String joinWay;

    @Excel(name ="年龄")
    @ApiModelProperty(value = "年龄")
    private Integer age;

    @Excel(name ="生日")
    @ApiModelProperty(value = "生日")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDate birthday;

    @Excel(name ="班级名称")
    @TableField(exist = false)
    @ApiModelProperty(value = "班级名称")
    private String className;

    @ApiModelProperty(value = "年级")
    private Long gradeId;

    @Excel(name ="年级")
    @TableField(exist = false)
    private String gradeName;

    @Excel(name ="学校名称")
    @TableField(exist = false)
    @ApiModelProperty(value = "学校名称")
    private String schoolName;


    @Excel(name ="备注")
    @ApiModelProperty(value = "备注")
    private String remark;

    @Excel(name ="学管师")
    @TableField(exist = false)
    @ApiModelProperty(value = "学管师")
    private String counselorName;

    @Excel(name ="跟进人")
    @ApiModelProperty(value = "顾问（未用）")
    private Long counselorId;

    @Excel(name ="创建者")
    @ApiModelProperty(value = "创建者")
    private Long creator;

    @Excel(name ="添加时间")
    @ApiModelProperty(value = "添加时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDateTime addTime;

    @ApiModelProperty(value = "学管师id")
    private Long managementId;

    @Excel(name ="跟进人")
    @TableField(exist = false)
    private String counselor;

    @Excel(name ="学管师")
    @TableField(exist = false)
    private String management;

    // 每页显示数据
    @TableField(exist = false)
    private Integer pageSize;

    // 当前页码
    @TableField(exist = false)
    private Integer pageNum;

    @TableField(exist = false)
    private List<Long> ids;

// 分配跟进人 学管师 按钮
    @TableField(exist = false)
    private String type;

    @TableField(exist = false)
    private String  courseName;


    @TableField(exist = false)
    private String  courseId;

//    创建时间
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private String startTime;

    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private String endTime;

    /**
     * 删除开始时间
     */
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private String delStartTime;

    /**
     * 删除结束时间
     */
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private String delEndTime;

    // 生日开始时间

    @TableField(exist = false)
    @JsonFormat(pattern = "MM-dd")
    @DateTimeFormat(pattern = "MM-dd")
    private String bStartTime;


    //生日结束时间
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private String bEndTime;

    //最大年龄
    @TableField(exist = false)
    private Integer maxAge;

    //最小年龄
    @TableField(exist = false)
    private Integer minAge;



    // 结业开始时间
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private String gStartTime;


    //结业结束时间
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private String gEndTime;

    @TableField(exist = false)
    private String exceedingClass;

    /**
     * 导出设置
     */
    @TableField(exist = false)
    private Long size;


    @TableField(exist = false)
    private Long  current;

    @TableField(exist = false)
    private String joinName;

    // 课时
    @TableField(exist = false)
    private Integer countLessonComplete;

    // 单价
    @TableField(exist = false)
    private BigDecimal unitPrice;

    //消费金额
    @TableField(exist = false)
    private BigDecimal spendAmount;

    @TableField(exist = false)
    private  String[] courses;

    // 本周、月新增线索时间
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate sTime;


    // 本周、月新增线索时间
    @TableField(exist = false)
    @JsonFormat(pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate eTime;


    //我的 1 是
    @TableField(exist = false)
    private String mine;

    // 就读学校
    private String attendSchool;

    // 删除人
    private Long deletePeopleId;

    // 删除原因
    private String  deleteReason;

    // 删除时间
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private LocalDateTime  deleteTime;

    //创建人名
    @TableField(exist = false)
    private String creatName;

    //删除人姓名
    @TableField(exist = false)
    private String deletePeople;

    @ApiModelProperty(value = "计划时间")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @TableField(exist = false)
    private String planTime;

    @TableField(exist = false)
    private String wxParam;


    // 主要联系人
    @TableField(exist = false)
    private StudentUser defaultUser;


    // 备用联系人
    @TableField(exist = false)
    private StudentUser backupUser;


    @TableField(exist = false)
    private String ageName;

    @TableField(exist = false)
    private String param;
}
